package com.violet.utils;

import com.violet.domain.po.User;

import java.time.LocalDateTime;

/**
 * 构建各种初始化的 PO 对象
 * 用于创建初始插入 MySQL 的数据
 */
public class POUtils {

    public static User getUser(String phone) {
        return new User()
            .setId(IdUtils.getId("U"))
            .setPhone(phone)
            .setUsername("游客")
            .setImage("user.jpg")
            .setStatus(true)
            .setOrderCount(0)
            .setTotalConsumption(0d)
            .setCreateTime(LocalDateTime.now())
            .setLastLoginTime(LocalDateTime.now());
    }

}
